package com.dmpp.captcha;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author 北橙
 * @Create 2022/6/13
 * @Description (通用) 验证相关接口
 */
@Tag(name = "(通用) 验证相关接口", description = "(通用) 验证相关接口")
@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    @Resource
    private CaptchaService captchaService;

    @Operation(summary = "获取验证码", description = "获取验证码")
    @RequestMapping(value = "/getCaptcha", method = {RequestMethod.POST, RequestMethod.GET})
    public void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
        captchaService.getCaptcha(request, response);
    }
}
